package com.clz.appdesign.viewpager;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;

import com.clz.appdesign.appdependence.base.BaseActivity;
import com.clz.appdesign.myapp.R;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ViewPagerActivity extends BaseActivity {

    @BindView(R.id.vp_reba)
    ViewPager mVpReba;
    private List<ImageView> rebaImages = new ArrayList();
    private AdapterViewPager mAdapter;
    @Override
    public void initToolbar() {

    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        setAllowFullScreen(true);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initView() {
        ButterKnife.bind(this);
        ImageView reba1 = new ImageView(this);
        reba1.setImageResource(R.drawable.reba1);
        ImageView reba2 = new ImageView(this);
        reba2.setImageResource(R.drawable.reba2);
        ImageView reba3 = new ImageView(this);
        reba3.setImageResource(R.drawable.reba4);
        ImageView reba4 = new ImageView(this);
        reba4.setImageResource(R.drawable.reba5);
        ImageView reba5 = new ImageView(this);
        reba5.setImageResource(R.drawable.reba8);
        rebaImages.add(reba1);
        rebaImages.add(reba2);
        rebaImages.add(reba3);
        rebaImages.add(reba4);
        rebaImages.add(reba5);
        for (int i = 0; i < rebaImages.size(); i++) {
            rebaImages.get(i).setScaleType(ImageView.ScaleType.FIT_XY);
        }
        //setSteepStatusBar(true);
        setAllowFullScreen(true);
    }

    @Override
    public void initData() {
        mAdapter=new AdapterViewPager(rebaImages);
        mVpReba.setAdapter(mAdapter);
    }

    @Override
    public void doBusiness(Context mContext) {

    }

    @Override
    public int layoutResID() {
        return R.layout.activity_view_pager;
    }

}
